import { ApiResp } from "@/types/response";
import { apiClient } from ".";


export const payService = {

  requestPayment: async (orderId: number) => {
    try {
      const response = await apiClient.post<ApiResp<string>>("/pay/request", { orderId })
      if (response.data.code === 0 && "data" in response.data) {
        return response.data.data;
      }
      return null;
    }
    catch (error) {
      console.error("Error:", error);
      return null;
    }

  }

}